{template '_header'}
<div class="page-heading"> <h2><i class="fa fa-circle-o"></i>七牛存储</h2> </div>

<form method="post" class="form-horizontal form-validate">
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启</label>
        <div class="col-sm-9">
            {ifp 'sysset.qiniu.edit'}
            <label class="radio-inline"><input type="radio" name="data[upload]" value="1" {if $data['upload']==1} checked="checked"{/if} onclick="openQiniu(true)"/>开启</label>
            <label class="radio-inline"><input type="radio" name="data[upload]" value="0" {if empty($data['upload'])} checked="checked"{/if}  onclick="openQiniu(false)"/>关闭</label>
            <span class="help-block">开启七牛存储，关闭则本地存储，如果用户可自己单独设七牛存储 ，不设置则用系统的设置 <a href="http://www.qiniu.com/" target="_blank">七牛存储</a></span>
            {else}
            <div class='form-control-static'>{if $data['upload']==1}开启{else}关闭{/if}</div>
            {/if}
        </div>
    </div>
    <div id='qiniu' {if empty($data['upload'])}style='display:none'{/if}>
        <div class="form-group " >
            <label class="col-xs-12 col-sm-3 col-md-2 control-label must">存储区域</label>
            <div class="col-sm-9">
                {ifp 'sysset.qiniu.edit'}
                <select name="data[zone]" class="form-control">
                    <option value="zone0" {if $data['zone']=='zone0'} selected{/if}>华东</option>
                    <option value="zone1" {if $data['zone']=='zone1'} selected{/if}>华北</option>
                </select>
                {else}
                <div class='form-control-static'>{if $data['zone']=='zone0'}华东{else}华北{/if}</div>
                {/if}
            </div>
        </div>
        <div class="form-group " >
            <label class="col-xs-12 col-sm-3 col-md-2 control-label must">ACCESS_KEY</label>
            <div class="col-sm-9">
                {ifp 'sysset.qiniu.edit'}
                <input type="text" name="data[access_key]" class="form-control" value="{$data['access_key']}" data-rule-required='true'>
                {else}
                <div class='form-control-static'>{$data['access_key']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label must">SECRET_KEY</label>
            <div class="col-sm-9">
                {ifp 'sysset.qiniu.edit'}
                <input type="text" name="data[secret_key]" class="form-control" value="{$data['secret_key']}"
                       data-rule-required='true'/>
                {else}
                <div class='form-control-static'>{$data['secret_key']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label must">BUCKET(空间名称)</label>
            <div class="col-sm-9">
                {ifp 'sysset.qiniu.edit'}
                <input type="text" name="data[bucket]" class="form-control" value="{$data['bucket']}"
                       data-rule-required='true'/>
                {else}
                <div class='form-control-static'>{$data['bucket']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label must">URL(空间链接)</label>
            <div class="col-sm-9">
                {ifp 'sysset.qiniu.edit'}
                <input type="text" name="data[url]" class="form-control" value="{$data['url']}" data-rule-required='true'/>
                {else}
                <div class='form-control-static'>{$data['url']}</div>
                {/if}
            </div>
        </div>
 
</div>
    {ifp 'sysset.qiniu.edit'}
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-2 control-label "></label>
        <div class="col-sm-9">
            <input type="submit" value="提交" class="btn btn-primary"/>
        </div>
    </div>
    {/if}
    <script language="javascript">
        function openQiniu(open) {
            if (open) {
                $('#qiniu').show();
            } else {
                $('#qiniu').hide();
            }
        }
    </script>

</form>
{template '_footer'}